widget: Remove gtk_widget_get_own_allocation
authorTimm Bäder <mail@baedert.org>
Sat, 7 Apr 2018 08:13:36 +0000 (10:13 +0200)
committerTimm Bäder <mail@baedert.org>
Tue, 10 Apr 2018 07:43:47 +0000 (09:43 +0200)
Use compute_bounds everywhere.

gtk/gtkwidget.c
gtk/gtkwidgetprivate.h

index 57590f1f2fd06b50315e925b9d5190b1bb714096..d9ed6d06e7874ac73e3ec6cc0894057a342ce7cb 100644 (file)
@@ -11464,25 +11464,6 @@ gtk_widget_get_outer_allocation (GtkWidget    *widget,
   allocation->height -= margin.top + margin.bottom;
 }
 
-void
-gtk_widget_get_own_allocation (GtkWidget    *widget,
-                               GdkRectangle *allocation)
-{
-  GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
-  GtkBorder margin, border, padding;
-  GtkCssStyle *style;
-
-  style = gtk_css_node_get_style (priv->cssnode);
-  get_box_margin (style, &margin);
-  get_box_border (style, &border);
-  get_box_padding (style, &padding);
-
-  allocation->x = -padding.left - border.left;
-  allocation->y = -padding.top - border.top;
-  allocation->width = priv->allocation.width - margin.left - margin.right;
-  allocation->height = priv->allocation.height -margin.top - margin.bottom;
-}
-
 /**
  * gtk_widget_compute_bounds:
  * @widget: the #GtkWidget to query
@@ -11506,13 +11487,25 @@ gtk_widget_compute_bounds (GtkWidget       *widget,
                            GtkWidget       *target,
                            graphene_rect_t *out_bounds)
 {
+  GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
+  GtkBorder margin, border, padding;
+  GtkCssStyle *style;
   GtkAllocation alloc;
 
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
   g_return_val_if_fail (GTK_IS_WIDGET (target), FALSE);
   g_return_val_if_fail (out_bounds != NULL, FALSE);
 
-  gtk_widget_get_own_allocation (widget, &alloc);
+  style = gtk_css_node_get_style (priv->cssnode);
+  get_box_margin (style, &margin);
+  get_box_border (style, &border);
+  get_box_padding (style, &padding);
+
+  alloc.x = - (padding.left + border.left);
+  alloc.y = - (padding.top + border.top);
+  alloc.width = priv->allocation.width - margin.left - margin.right;
+  alloc.height = priv->allocation.height -margin.top - margin.bottom;
+
   if (!gtk_widget_translate_coordinates (widget,
                                          target,
                                          alloc.x, alloc.y,
@@ -11522,7 +11515,7 @@ gtk_widget_compute_bounds (GtkWidget       *widget,
       return FALSE;
     }
 
-  graphene_rect_init (out_bounds, 
+  graphene_rect_init (out_bounds,
                       alloc.x,
                       alloc.y,
                       alloc.width,
index 971292ad385072e211cec0c4b0e82e88176dd06d..a6be3a51d10814e2415953eba7186b0878db26a5 100644 (file)
@@ -321,9 +321,6 @@ gboolean          gtk_widget_focus_move                    (GtkWidget        *wi
                                                             GPtrArray        *focus_order);
 void              gtk_widget_get_outer_allocation          (GtkWidget        *widget,
                                                             GtkAllocation    *allocation);
-void              gtk_widget_get_own_allocation            (GtkWidget        *widget,
-                                                            GtkAllocation    *allocation);
-
 void              gtk_widget_get_surface_allocation         (GtkWidget *widget,
                                                             GtkAllocation *allocation);